<?php

//search for sites by zip and service type
function sitesByZipAndService( $zipCode, $serviceTypeID )
{
	//query db (do not list flagged sites)
	//TO-DO find all sites that can be listed and service given zip with selected service. 
	$query = "SELECT * FROM codeJam_dbo.Site S LEFT OUTER JOIN codeJam_dbo.Area A ON S.AreaID=A.AreaID LEFT OUTER JOIN codeJam_dbo.SiteService SS ON SS.SiteID=S.SiteID WHERE SS.ServiceTypeID = 8 OR A.Zip = '" .$zipCode."' ";
	$result = mysql_query( $query ) or die(mysql_error());
	
	return $result;
	
}

?>
